package pratima.Singleton;

	public class SingletonDemo {
 
	public static void main(String[] args) {
		
		Singleton singleton2 = Singleton.getSingletonInstace("Singleton2");
		System.out.println("Parameters test "+singleton2.singletonString);
		
		//singleton2 is assigned to singleton1--static instance
		Singleton singleton1 = Singleton.getSingletonInstace();
		System.out.println("No parameters test "+singleton1.singletonString);
		
		Singleton singleton3 = Singleton.getSingletonInstace();
		System.out.println("No parameters test "+singleton3.singletonString);
		
		Singleton singleton4 = Singleton.getSingletonInstace("Singleton2");
		System.out.println("Parameters test "+singleton4.singletonString);
		
		Singleton singleton5 = Singleton.getSingletonInstace();
		System.out.println("No parameters test "+singleton5.singletonString);
		
		Singleton singleton6 = Singleton.getSingletonInstace("Singleton2");
		System.out.println("Parameters test "+singleton6.singletonString);
		
		Singleton singleton7 = Singleton.getSingletonInstace();
		System.out.println("No parameters test "+singleton7.singletonString);
		
		Singleton singleton8 = Singleton.getSingletonInstace("Singleton2");
		System.out.println("Parameters test "+singleton8.singletonString);
	}
	
}
